import { hasPermission } from '@/directives/permission'
export const USER_MANAGE_COLUMNS = [
  {
    name: '用户名',
    key: 'username',
    width: 180,
    fixed: 'left',
    align: 'left',
    showOverflowTooltip: true
  },
  {
    name: '昵称',
    key: 'nickname',
    width: 180,
    align: 'left',
    showOverflowTooltip: true
  },
  {
    name: '性别',
    key: 'gender',
    width: 80,
    slot: 'gender'
  },
  {
    name: '头像',
    key: 'avatar',
    width: 160,
    slot: 'avatar'
  },
  {
    name: '邮箱',
    key: 'email',
    width: 200,
    showOverflowTooltip: true
  },
  {
    name: '状态',
    key: 'status',
    slot: 'status'
  },
  {
    name: '是否有密码',
    key: 'bindPassword',
    width: 130,
    slot: 'bindPassword'
  },
  {
    name: '是否绑定微信',
    key: 'bindwx',
    width: 130,
    slot: 'bindwx'
  },
  {
    name: '手机号',
    key: 'tel',
    width: 160
  },
  {
    name: '年龄',
    key: 'age'
  },
  {
    name: '职位',
    key: 'job',
    width: 180,
    showOverflowTooltip: true
  },
  {
    name: '注册时间',
    key: 'createTime',
    width: 200
  },
  {
    name: '简介',
    key: 'description',
    width: 200,
    showOverflowTooltip: true
  },
  {
    name: '操作',
    key: 'operate',
    fixed: 'right',
    width: 80,
    slot: 'operate',
    hidden: !hasPermission('user-list-manage-permission:btn:edit')
  }
].filter(o => !o.hidden)

export const DYNAMIC_COLUMNS = [
  {
    name: '昵称',
    key: 'nickname',
    align: 'left',
    showOverflowTooltip: true
  },
  {
    name: '动态类型',
    key: 'dynamicType',
    slot: 'dynamicType',
    width: 120
  },
  {
    name: '动态对象',
    key: 'dynamicDesc',
    slot: 'dynamicDesc'
  },
  {
    name: '文章标题',
    key: 'articleTitle',
    showOverflowTooltip: true
  },
  {
    name: '友圈内容',
    key: 'circleContent',
    showOverflowTooltip: true
  },
  {
    name: '关注者用户名',
    key: 'focusUsername',
    showOverflowTooltip: true
  },
  {
    name: '生成时间',
    key: 'createTime',
    width: 200
  },
  {
    name: '操作',
    key: 'operate',
    fixed: 'right',
    width: 100,
    slot: 'operate',
    hidden: !hasPermission('user-dynamic-manage-permission:btn:delete')
  }
].filter(o => !o.hidden)
